# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=evolution-ews
pkgver=3.30.1
pkgrel=1
pkgdesc="MS Exchange integration through Exchange Web Services"
url="https://wiki.gnome.org/Apps/Evolution/EWS"
arch=(x86_64)
license=(LGPL2.1)
depends=(libmspack evolution)
makedepends=(git cmake ninja intltool python)
_commit=eed78ea5518eb6641b975a7442b1ac2cebd4c27f  # tags/3.30.1^0
source=("git+https://gitlab.gnome.org/GNOME/evolution-ews.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^EVOLUTION_EWS_//;s/_/./g;s/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
}

build() {
  cd build
  cmake ../$pkgname -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIBEXEC_INSTALL_DIR=/usr/lib \
    -DSYSCONF_INSTALL_DIR=/etc
  cmake --build .
}

package() {
  DESTDIR="$pkgdir" cmake --build build --target install
}
